package com.ruoyi.system.service.zhaungxiuservice.shopService.impl;

import com.ruoyi.system.domain.zhuangxiumain.orderformMain.OrderVoucher;
import com.ruoyi.system.mapper.zhuangxiumapper.orderformMapper.OrderVoucherMapper;
import com.ruoyi.system.service.zhaungxiuservice.shopService.OrderVoucherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderVoucherServiceImpl implements OrderVoucherService {

    @Autowired
    private OrderVoucherMapper orderVoucherMapper;

    /**
     * 查询线下支付订单凭证
     *
     * @param orderVoucherId 线下支付订单凭证ID
     * @return 线下支付订单凭证
     */
    @Override
    public OrderVoucher selectOrderVoucherById(Long orderVoucherId)
    {
        return orderVoucherMapper.selectOrderVoucherById(orderVoucherId);
    }

    /**
     * 查询线下支付订单凭证列表
     *
     * @param orderVoucher 线下支付订单凭证
     * @return 线下支付订单凭证
     */
    @Override
    public List<OrderVoucher> selectOrderVoucherList(OrderVoucher orderVoucher)
    {
        return orderVoucherMapper.selectOrderVoucherList(orderVoucher);
    }

    /**
     * 新增线下支付订单凭证
     *
     * @param orderVoucher 线下支付订单凭证
     * @return 结果
     */
    @Override
    public int insertOrderVoucher(OrderVoucher orderVoucher)
    {
        return orderVoucherMapper.insertOrderVoucher(orderVoucher);
    }

    /**
     * 修改线下支付订单凭证
     *
     * @param orderVoucher 线下支付订单凭证
     * @return 结果
     */
    @Override
    public int updateOrderVoucher(OrderVoucher orderVoucher)
    {
        return orderVoucherMapper.updateOrderVoucher(orderVoucher);
    }

    /**
     * 批量删除线下支付订单凭证
     *
     * @param orderVoucherIds 需要删除的线下支付订单凭证ID
     * @return 结果
     */
    @Override
    public int deleteOrderVoucherByIds(Long[] orderVoucherIds)
    {
        return orderVoucherMapper.deleteOrderVoucherByIds(orderVoucherIds);
    }

    /**
     * 删除线下支付订单凭证信息
     *
     * @param orderVoucherId 线下支付订单凭证ID
     * @return 结果
     */
    @Override
    public int deleteOrderVoucherById(Long orderVoucherId)
    {
        return orderVoucherMapper.deleteOrderVoucherById(orderVoucherId);
    }

    /**
     * 根据订单ID查询支付凭证
     * @param orderId
     * @return
     */
    public OrderVoucher selectOrderVoucherByOrderId(Long orderId){
        return orderVoucherMapper.selectOrderVoucherByOrderId(orderId);
    }
}
